class Person:
    def __init__(self, name, weight):
        self.name = name
        self.__weight = weight

    def run(self):
        self.__weight -= 5
        print(f'{self.name}跑步了，减去了5公斤,现有体重{self.__weight}')

    def eat(self):
        self.__weight += 10
        print(f'{self.name}吃东西了，增加了10公斤,现有体重{self.__weight}')

    def __str__(self):
        return f'{self.name}的体重是{self.__weight}'




if __name__ == '__main__':
    elephant = Person('大象', 80)
    elephant.run()
    elephant.eat()
    print(elephant)
    tager = Person('老虎', 50)

    tager.run()
    tager.eat()





